\(\int \frac {\sqrt {g \sin (e+f x)}}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))} \, dx\) [17]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F(-1)]
   Mupad [F(-1)]

Optimal result

Integrand size = 40, antiderivative size = 114 \[ \int \frac {\sqrt {g \sin (e+f x)}}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))} \, dx=\frac {\sqrt {g} \arctan \left (\frac {\sqrt {a} \sqrt {g} \cos (e+f x)}{\sqrt {2} \sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {2} \sqrt {a} c f}+\frac {\sec (e+f x) \sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}{a c f} \]

[Out]

1/2*arctan(1/2*cos(f*x+e)*a^(1/2)*g^(1/2)*2^(1/2)/(g*sin(f*x+e))^(1/2)/(a+a*sin(f*x+e))^(1/2))*g^(1/2)/c/f*2^(
1/2)/a^(1/2)+sec(f*x+e)*(g*sin(f*x+e))^(1/2)*(a+a*sin(f*x+e))^(1/2)/a/c/f

Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {3015, 2861, 211, 3009, 12, 30} \[ \int \frac {\sqrt {g \sin (e+f x)}}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))} \, dx=\frac {\sqrt {g} \arctan \left (\frac {\sqrt {a} \sqrt {g} \cos (e+f x)}{\sqrt {2} \sqrt {a \sin (e+f x)+a} \sqrt {g \sin (e+f x)}}\right )}{\sqrt {2} \sqrt {a} c f}+\frac {\sec (e+f x) \sqrt {a \sin (e+f x)+a} \sqrt {g \sin (e+f x)}}{a c f} \]

[In]

Int[Sqrt[g*Sin[e + f*x]]/(Sqrt[a + a*Sin[e + f*x]]*(c - c*Sin[e + f*x])),x]

[Out]

(Sqrt[g]*ArcTan[(Sqrt[a]*Sqrt[g]*Cos[e + f*x])/(Sqrt[2]*Sqrt[g*Sin[e + f*x]]*Sqrt[a + a*Sin[e + f*x]])])/(Sqrt
[2]*Sqrt[a]*c*f) + (Sec[e + f*x]*Sqrt[g*Sin[e + f*x]]*Sqrt[a + a*Sin[e + f*x]])/(a*c*f)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 2861

Int[1/(Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*Sqrt[(c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]]), x_Symbol] :> D
ist[-2*(a/f), Subst[Int[1/(2*b^2 - (a*c - b*d)*x^2), x], x, b*(Cos[e + f*x]/(Sqrt[a + b*Sin[e + f*x]]*Sqrt[c +
 d*Sin[e + f*x]]))], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 -
 d^2, 0]

Rule 3009

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/(Sqrt[(g_.)*sin[(e_.) + (f_.)*(x_)]]*((c_) + (d_.)*sin[(e_.) +
(f_.)*(x_)])), x_Symbol] :> Dist[-2*(b/f), Subst[Int[1/(b*c + a*d + c*g*x^2), x], x, b*(Cos[e + f*x]/(Sqrt[g*S
in[e + f*x]]*Sqrt[a + b*Sin[e + f*x]]))], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b*c - a*d, 0] && EqQ[a^
2 - b^2, 0]

Rule 3015

Int[Sqrt[(g_.)*sin[(e_.) + (f_.)*(x_)]]/(Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*((c_) + (d_.)*sin[(e_.) +
(f_.)*(x_)])), x_Symbol] :> Dist[(-a)*(g/(b*c - a*d)), Int[1/(Sqrt[g*Sin[e + f*x]]*Sqrt[a + b*Sin[e + f*x]]),
x], x] + Dist[c*(g/(b*c - a*d)), Int[Sqrt[a + b*Sin[e + f*x]]/(Sqrt[g*Sin[e + f*x]]*(c + d*Sin[e + f*x])), x],
 x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b*c - a*d, 0] && (EqQ[a^2 - b^2, 0] || EqQ[c^2 - d^2, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {g \int \frac {\sqrt {a+a \sin (e+f x)}}{\sqrt {g \sin (e+f x)} (c-c \sin (e+f x))} \, dx}{2 a}-\frac {g \int \frac {1}{\sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}} \, dx}{2 c} \\ & = -\frac {g \text {Subst}\left (\int \frac {1}{c g x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{f}+\frac {(a g) \text {Subst}\left (\int \frac {1}{2 a^2+a g x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{c f} \\ & = \frac {\sqrt {g} \arctan \left (\frac {\sqrt {a} \sqrt {g} \cos (e+f x)}{\sqrt {2} \sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {2} \sqrt {a} c f}-\frac {\text {Subst}\left (\int \frac {1}{x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{c f} \\ & = \frac {\sqrt {g} \arctan \left (\frac {\sqrt {a} \sqrt {g} \cos (e+f x)}{\sqrt {2} \sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {2} \sqrt {a} c f}+\frac {\sec (e+f x) \sqrt {g \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}{a c f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.22 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.17 \[ \int \frac {\sqrt {g \sin (e+f x)}}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))} \, dx=\frac {\csc (2 (e+f x)) \sqrt {\sin (e+f x)} \sqrt {g \sin (e+f x)} \sqrt {a (1+\sin (e+f x))} \left (2 \sqrt {c} \sqrt {\sin (e+f x)}-\sqrt {2} \arctan \left (\frac {\sqrt {2} \sqrt {c} \sqrt {\sin (e+f x)}}{\sqrt {c-c \sin (e+f x)}}\right ) \sqrt {c-c \sin (e+f x)}\right )}{a c^{3/2} f} \]

[In]

Integrate[Sqrt[g*Sin[e + f*x]]/(Sqrt[a + a*Sin[e + f*x]]*(c - c*Sin[e + f*x])),x]

[Out]

(Csc[2*(e + f*x)]*Sqrt[Sin[e + f*x]]*Sqrt[g*Sin[e + f*x]]*Sqrt[a*(1 + Sin[e + f*x])]*(2*Sqrt[c]*Sqrt[Sin[e + f
*x]] - Sqrt[2]*ArcTan[(Sqrt[2]*Sqrt[c]*Sqrt[Sin[e + f*x]])/Sqrt[c - c*Sin[e + f*x]]]*Sqrt[c - c*Sin[e + f*x]])
)/(a*c^(3/2)*f)

Maple [A] (verified)

Time = 3.34 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.39

method result size
default \(-\frac {\left (\sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )}\, \sin \left (f x +e \right )-2 \arctan \left (\sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )}\right ) \cos \left (f x +e \right )+\sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )}\, \cos \left (f x +e \right )+\sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )}\right ) \sqrt {g \sin \left (f x +e \right )}}{c f \left (-\cos \left (f x +e \right )+\sin \left (f x +e \right )-1\right ) \sqrt {a \left (1+\sin \left (f x +e \right )\right )}\, \sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )}}\) \(158\)

[In]

int((g*sin(f*x+e))^(1/2)/(c-c*sin(f*x+e))/(a+a*sin(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/c/f*((csc(f*x+e)-cot(f*x+e))^(1/2)*sin(f*x+e)-2*arctan((csc(f*x+e)-cot(f*x+e))^(1/2))*cos(f*x+e)+(csc(f*x+e
)-cot(f*x+e))^(1/2)*cos(f*x+e)+(csc(f*x+e)-cot(f*x+e))^(1/2))*(g*sin(f*x+e))^(1/2)/(-cos(f*x+e)+sin(f*x+e)-1)/
(a*(1+sin(f*x+e)))^(1/2)/(csc(f*x+e)-cot(f*x+e))^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.36 (sec) , antiderivative size = 385, normalized size of antiderivative = 3.38 \[ \int \frac {\sqrt {g \sin (e+f x)}}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))} \, dx=\left [\frac {\sqrt {2} a \sqrt {-\frac {g}{a}} \cos \left (f x + e\right ) \log \left (\frac {17 \, g \cos \left (f x + e\right )^{3} + 4 \, \sqrt {2} {\left (3 \, \cos \left (f x + e\right )^{2} + {\left (3 \, \cos \left (f x + e\right ) + 4\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 4\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {g \sin \left (f x + e\right )} \sqrt {-\frac {g}{a}} + 3 \, g \cos \left (f x + e\right )^{2} - 18 \, g \cos \left (f x + e\right ) + {\left (17 \, g \cos \left (f x + e\right )^{2} + 14 \, g \cos \left (f x + e\right ) - 4 \, g\right )} \sin \left (f x + e\right ) - 4 \, g}{\cos \left (f x + e\right )^{3} + 3 \, \cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right )^{2} - 2 \, \cos \left (f x + e\right ) - 4\right )} \sin \left (f x + e\right ) - 2 \, \cos \left (f x + e\right ) - 4}\right ) + 8 \, \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {g \sin \left (f x + e\right )}}{8 \, a c f \cos \left (f x + e\right )}, -\frac {\sqrt {2} a \sqrt {\frac {g}{a}} \arctan \left (\frac {\sqrt {2} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {g \sin \left (f x + e\right )} \sqrt {\frac {g}{a}} {\left (3 \, \sin \left (f x + e\right ) - 1\right )}}{4 \, g \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right ) \cos \left (f x + e\right ) - 4 \, \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {g \sin \left (f x + e\right )}}{4 \, a c f \cos \left (f x + e\right )}\right ] \]

[In]

integrate((g*sin(f*x+e))^(1/2)/(c-c*sin(f*x+e))/(a+a*sin(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

[1/8*(sqrt(2)*a*sqrt(-g/a)*cos(f*x + e)*log((17*g*cos(f*x + e)^3 + 4*sqrt(2)*(3*cos(f*x + e)^2 + (3*cos(f*x +
e) + 4)*sin(f*x + e) - cos(f*x + e) - 4)*sqrt(a*sin(f*x + e) + a)*sqrt(g*sin(f*x + e))*sqrt(-g/a) + 3*g*cos(f*
x + e)^2 - 18*g*cos(f*x + e) + (17*g*cos(f*x + e)^2 + 14*g*cos(f*x + e) - 4*g)*sin(f*x + e) - 4*g)/(cos(f*x +
e)^3 + 3*cos(f*x + e)^2 + (cos(f*x + e)^2 - 2*cos(f*x + e) - 4)*sin(f*x + e) - 2*cos(f*x + e) - 4)) + 8*sqrt(a
*sin(f*x + e) + a)*sqrt(g*sin(f*x + e)))/(a*c*f*cos(f*x + e)), -1/4*(sqrt(2)*a*sqrt(g/a)*arctan(1/4*sqrt(2)*sq
rt(a*sin(f*x + e) + a)*sqrt(g*sin(f*x + e))*sqrt(g/a)*(3*sin(f*x + e) - 1)/(g*cos(f*x + e)*sin(f*x + e)))*cos(
f*x + e) - 4*sqrt(a*sin(f*x + e) + a)*sqrt(g*sin(f*x + e)))/(a*c*f*cos(f*x + e))]

Sympy [F]

\[ \int \frac {\sqrt {g \sin (e+f x)}}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))} \, dx=- \frac {\int \frac {\sqrt {g \sin {\left (e + f x \right )}}}{\sqrt {a \sin {\left (e + f x \right )} + a} \sin {\left (e + f x \right )} - \sqrt {a \sin {\left (e + f x \right )} + a}}\, dx}{c} \]

[In]

integrate((g*sin(f*x+e))**(1/2)/(c-c*sin(f*x+e))/(a+a*sin(f*x+e))**(1/2),x)

[Out]

-Integral(sqrt(g*sin(e + f*x))/(sqrt(a*sin(e + f*x) + a)*sin(e + f*x) - sqrt(a*sin(e + f*x) + a)), x)/c

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 270 vs. \(2 (96) = 192\).

Time = 0.32 (sec) , antiderivative size = 270, normalized size of antiderivative = 2.37 \[ \int \frac {\sqrt {g \sin (e+f x)}}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))} \, dx=\frac {\frac {4 \, \sqrt {2} \sqrt {g} \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )^{\frac {3}{2}}}{\sqrt {a} c + \frac {\sqrt {a} c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {{\left (\sqrt {a} c + \frac {\sqrt {a} c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}} - \frac {2 \, \sqrt {2} \sqrt {g} \arctan \left (\sqrt {\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )}{\sqrt {a} c} + \frac {\sqrt {2} \sqrt {g} \sqrt {\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}} + \sqrt {2} \sqrt {g}}{\sqrt {a} c + \frac {\sqrt {a} c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}} + \frac {\sqrt {2} \sqrt {g} \sqrt {\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}} - \sqrt {2} \sqrt {g}}{\sqrt {a} c + \frac {\sqrt {a} c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}}{2 \, f} \]

[In]

integrate((g*sin(f*x+e))^(1/2)/(c-c*sin(f*x+e))/(a+a*sin(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

1/2*(4*sqrt(2)*sqrt(g)*(sin(f*x + e)/(cos(f*x + e) + 1))^(3/2)/(sqrt(a)*c + sqrt(a)*c*sin(f*x + e)/(cos(f*x +
e) + 1) - (sqrt(a)*c + sqrt(a)*c*sin(f*x + e)/(cos(f*x + e) + 1))*sin(f*x + e)/(cos(f*x + e) + 1)) - 2*sqrt(2)
*sqrt(g)*arctan(sqrt(sin(f*x + e)/(cos(f*x + e) + 1)))/(sqrt(a)*c) + (sqrt(2)*sqrt(g)*sqrt(sin(f*x + e)/(cos(f
*x + e) + 1)) + sqrt(2)*sqrt(g))/(sqrt(a)*c + sqrt(a)*c*sin(f*x + e)/(cos(f*x + e) + 1)) + (sqrt(2)*sqrt(g)*sq
rt(sin(f*x + e)/(cos(f*x + e) + 1)) - sqrt(2)*sqrt(g))/(sqrt(a)*c + sqrt(a)*c*sin(f*x + e)/(cos(f*x + e) + 1))
)/f

Giac [F(-1)]

Timed out. \[ \int \frac {\sqrt {g \sin (e+f x)}}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))} \, dx=\text {Timed out} \]

[In]

integrate((g*sin(f*x+e))^(1/2)/(c-c*sin(f*x+e))/(a+a*sin(f*x+e))^(1/2),x, algorithm="giac")

[Out]

Timed out

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {g \sin (e+f x)}}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))} \, dx=\int \frac {\sqrt {g\,\sin \left (e+f\,x\right )}}{\sqrt {a+a\,\sin \left (e+f\,x\right )}\,\left (c-c\,\sin \left (e+f\,x\right )\right )} \,d x \]

[In]

int((g*sin(e + f*x))^(1/2)/((a + a*sin(e + f*x))^(1/2)*(c - c*sin(e + f*x))),x)

[Out]

int((g*sin(e + f*x))^(1/2)/((a + a*sin(e + f*x))^(1/2)*(c - c*sin(e + f*x))), x)